package team.knowers.agency.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import team.knowers.agency.dao.entity.TouristDO;
import team.knowers.agency.dao.mapper.TouristMapper;
import team.knowers.agency.service.TouristService;

import java.util.List;

@Service
@RequiredArgsConstructor
public class TouristServiceImpl extends ServiceImpl<TouristMapper, TouristDO> implements TouristService {

    @Override
    public List<TouristDO> find() {
        LambdaQueryWrapper<TouristDO> wrapper= Wrappers.lambdaQuery(TouristDO.class)
                .eq(TouristDO::getDelFlag,0);
        List<TouristDO> touristDOS=baseMapper.selectList(wrapper);
        return touristDOS;
    }

    @Override
    public TouristDO findOne(String name) {
        LambdaQueryWrapper<TouristDO> wrapper=Wrappers.lambdaQuery(TouristDO.class)
                .eq(TouristDO::getName,name);
        TouristDO touristDO=baseMapper.selectOne(wrapper);
        return touristDO;
    }
}
